# Maintainer: David Runge <dvzrv@archlinux.org>

pkgname=sonivox
pkgver=3.6.11
pkgrel=1
pkgdesc="Fork of the AOSP 'platform_external_sonivox' to use outside of Android"
arch=(loong64 x86_64)
url="https://github.com/pedrolcl/sonivox"
license=(Apache)
depends=(glibc)
makedepends=(cmake gtest)
provides=(libsonivox.so)
options=(debug)
source=($pkgname-$pkgver.tar.gz::https://github.com/pedrolcl/$pkgname/archive/refs/tags/v$pkgver.tar.gz)
sha256sums=('7d7f34508c5475dc6f1c13d1facea084c17a5bca73d085ee9842dae62329a473')
b2sums=('e8cf193b72e09659405877246f804c972b415b8ae0f3c1a81ee92265ee7dc3f9bbd4893405dc881d9b6f23e9470ee49931ba3743508b56c9911dff314062335e')

build() {
  cmake \
    -B build -S $pkgname-$pkgver \
    -DCMAKE_BUILD_TYPE=None \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -Wno-dev
  cmake --build build
}

check() {
  ctest --test-dir build --output-on-failure
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}
